package cn.yuyiling.jelly.srai.controller;

import cn.yuyiling.jelly.qa.mongodb.entity.Question;
import cn.yuyiling.jelly.srai.api.RecommendQuestionsService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/recommendations")
public class RecommendQuestionsController {
    @DubboReference(scope = "remote")
    private RecommendQuestionsService recommendationService;


    @GetMapping("/weakness/{userId}")
    public List<Question> getRecommendationsByWeakness(@PathVariable String userId) {
        return recommendationService.recommendQuestionsByWeakness(userId);
    }
}